package com.company.test29;

import javax.swing.*;
import java.applet.Applet;

/**
 * Created by v on 16-11-25.
 */
public class Test2902 extends JFrame implements Runnable{
    private JLabel text=new JLabel("Hello World");

    public Test2902(){
        add(text);
        new Thread(this).start();
    }

    @Override
    public void run(){
        while (true){
            if(text.getText()==null){
                text.setText("Hello World");
            }else {
                text.setText(null);
            }

        }
    }

    public static void main(String[] args) {
        Test2902 test=new Test2902();
        test.setTitle("Hello world");
        test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        test.setLocationRelativeTo(null);
        test.setSize(200,200);
        test.setVisible(true);
    }
}